<?php
namespace Common\Controller;

use Common\Controller\AppframeController;

class AppbusinessbaseController extends AppbaseController {
	protected $business;
	protected $businessId;
	public function _initialize() {
		parent::_initialize();
        if(!IS_POST){
            $this->jsonReturn(0,'请求方式错误');
        }
        $token=I('token');
        if(!$token){
            $this->jsonReturn(2,'请先登陆');
        }
        $this->business=lt_get_business_by_token($token);
        if(!$this->business){
            $this->jsonReturn(2,'请先登陆');
        }
        if($this->business['status']==2){
            $this->jsonReturn(3,'请先绑定手机号');
        }
        if($this->business['status']==3){
            $this->jsonReturn(4,'请先选择商户类型');
        }
        if($this->business['status']==4){
            $this->jsonReturn(5,'请先补充资料');
        }
        if($this->business['status']==5){
            $this->jsonReturn(7,'您还未装修您的店铺，请先装修一下');
        }
        if($this->business['status']==0){
            $this->jsonReturn(0,'用户已被拉黑');
        }
        $this->businessId=$this->business['id'];
	}
    
}